/*
 * 广州丰石科技有限公司拥有本软件版权2020并保留所有权利。
 * Copyright 2020, Guangzhou Rich Stone Data Technologies Company Limited,
 * All rights reserved.
 */
package demo.service;

import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.ValueOperations;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/**
 * <b><code>IRedisCache</code></b>
 * <p/>
 * Description
 * <p/>
 * <b>Creation Time:</b> 2020/12/28 5:40 下午.
 *
 * @author wyfd
 * @since rziomp-be 1.0.0
 */
public interface RedisService {
    <T> ValueOperations<String, T> setObject(String key, T value);

    <T> ValueOperations<String, T> setObject(String key, T value, Long timeout, TimeUnit timeUnit);

    <T> T getObject(String key);

    void deleteObject(String key);

    void deleteObject(Collection collection);

    <T> ListOperations<String, T> setList(String key, List<T> dataList);

    <T> List<T> getList(String key);

    <T> BoundSetOperations<String, T> setSet(String key, Set<T> dataSet);

    <T> Set<T> getSet(String key);

    <T> HashOperations<String, String, T> setMap(String key, Map<String, T> dataMap);

    <T> Map<String, T> getMap(String key);

    Collection<String> keys(String pattern);
}
